<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@include file="/WEB-INF/jspf/meta/meta.jspf"%>
<title>添加教师信息</title>
<%@include file="/WEB-INF/jspf/adminPage.jspf"%>
</head>
<body>
	<div style="width: 500px;margin: 0 auto;">
		<div class="easyui-panel" title="添加教师信息" style="width:500px">
			<div style="padding: 10px 60px 20px 60px">
				<form id="ffadd" method="post">
					<table cellpadding="5" style="text-align: center;">
					<tr>
							<td>教师编号:</td>
							<td><input class="easyui-textbox" type="text"
								name="teacherId" data-options="required:true"></input></td>
						</tr>
						<tr>
							<td>教师姓名:</td>
							<td><input class="easyui-textbox" type="text"
								name="teacherName" data-options="required:true"></input></td>
						</tr>
						<tr>
							<td>教师生日:</td>
							<td><input class="easyui-datetimebox" type="text" name="teacherBirthday"
								data-options="required:false"></input></td>
						</tr>

						<tr>
							<td>教师电话:</td>
							<td><input class="easyui-textbox" type="text"
								name="teacherPhone" data-options="required:true"></input></td>
						</tr>
						
						<tr>
							<td>教师地址:</td>
							<td><input class="easyui-textbox" type="text" name="teacherAddr"
								data-options="required:false"></input></td>
						</tr>

						<tr>
							<td>教师性别:</td>
							<td>
								<input class="easyui-radiobutton" checked="checked" name="teacherSex" value="男" label="男">
								<input class="easyui-radiobutton" name="teacherSex" value="女" label="女">
							</td>
						</tr>
						
						<tr>
							<td>教师邮箱:</td>
							<td><input class="easyui-textbox" type="text" name="teacherEmail"
								data-options="required:false,validType:'email'"></input></td>
						</tr>

						<tr>
							<td>教师账号:</td>
							<td><input class="easyui-textbox" type="text"
								name="teacherAccount" data-options="required:true,editable:false"></input></td>
						</tr>
						
						<tr>
							<td>教师密码:</td>
							<td><input class="easyui-passwordbox" type="text" value="12345678" name="teacherPassword"
								data-options="required:true"></input></td>
						</tr>

						<tr>
							<td>教师入职日期:</td>
							<td><input class="easyui-datetimebox" type="text"
								name="teacherStartdate" data-options="required:true"></input></td>
						</tr>
						<tr style="display: none;">
							<td>教师离职日期:</td>
							<td><input class="easyui-datetimebox" type="text"
								name="teacherEnddate" data-options="required:false"></input></td>
						</tr>
						<tr>
							<td>教师状态:</td>
							<td><select  class="easyui-combobox" name=teacherSytle data-options="editable:false,required:true"
							style="width: 100px;">
								<option value="在职" selected="selected" >在职</option>
								</select>
						</tr>
						

						

					</table>
				</form>
				<div style="text-align: center; padding: 5px">
					<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">清除</a>
				</div>
			</div>
		</div>
		</div>
		<script type="text/javascript">
		
		function submitForm() {
			$('#ffadd').form({
				url:'<%=request.getContextPath()%>/teacher/addTea.json',
				onSubmit : function() {
					return $(this).form('validate');
				},
				success : function(data) {
					var d=JSON.parse(data)
					$.messager.show({
						title:'操作提示',
						msg:d.msg,
						timeout:3000,
						showType:'slide'
					});
					$('#ffadd').form('clear');
				}
			})
			$('#ffadd').submit()
		}
		
		function clearForm() {
			$('#ffadd').form('clear');
		}
	</script>
</body>
</html>